<!DOCTYPE html>
<html>
<head lang="zh-cn">
    <link href="$!{__beat.server.contextPath}/bootstrap/datepicker/datepicker3.css" rel="stylesheet">
    <link href="$!{__beat.server.contextPath}/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="$!{__beat.server.contextPath}/bootstrap/css/App.css" type="text/css" />
    <link rel="stylesheet" href="$!{__beat.server.contextPath}/bootstrap/css/font-awesome.min.css" type="text/css" />     
    <link rel="stylesheet" type="text/css" href="$!{__beat.server.contextPath}/css/wnl.css">
    <meta charset="UTF-8">
    <title>流量数据看板</title>
<style type="text/css">
        .table>thead>tr>th, .table>tbody>tr>th, .table>tfoot>tr>th, .table>thead>tr>td, .table>tbody>tr>td, .table>tfoot>tr>td {
        padding: 4px;
        font-size:10px;
        vertical-align: middle;      
    }
</style>
    <meta charset="UTF-8">
    <title>余额客户结构</title>
</head>
<body>
<div class="container-fluid">

    <div class="row" align="center" style="margin-bottom:8px; margin-top:5px;">
                <form class="form-inline" action="$!{__beat.server.contextPath}/customer/balancecs" method="post">
                        <div class="form-group" style="width:180px">
                            <label for="businessName" style="padding-left:15px;">业务线：</label>
                            <select id="businessName" name="businessName" class="form-control input-sm" style="align:center; width:100px; ">
                               #foreach($buss in $businessList)
                               #set($i = $velocityCount - 1)
                                    <option value="$buss" #if("$buss" == $!businessName) selected #end>$business_CN_Map.get("$buss")</option>
                                #end
                            </select>
                        </div>  
                        <div class="form-group">                       
                               <input type="submit" value="查询" class="btn btn-primary btn-xs"> 
                        </div>
                </form>
    </div>

<!-- 客户余额结构部分 指标对比 -->

        <div class="datacontent" id="qsContent">
            <div class="dataTit">
            <a href="http://wiki.58corp.com/index.php?title=收入看板指标#.E4.BD.99.E9.A2.9D.E5.AE.A2.E6.88.B7.E7.BB.93.E6.9E.84" target="_black" 
              style="font-size: 15px;color:black">
              <i class="mark"></i><span>$!{businessName_CN} -余额客户结构-指标对比</span>
            </a>
            </div>
 
            <div class="dataShow">
                <div id='customerProOption' dateGrp='stat_date' statType='day' customerType='all'>
                    <form class="form-inline">
                        <!-- <div  class="input-group input-group-sm" style="width: 20%;float: left">
                            <span class="input-group-addon">
                                <input id="time_checkbox_customerPro" type="checkbox">
                            </span>
                            <input id="time_input_customerPro" type="text" class="form-control time" placeholder="添加对比" disabled>
                        </div> -->
                        <div class="form-group input-group-s" style="margin-left: 20%">
                            <label for="customer_type">用户类型：</label>
                            <select id="customer_type" class="form-control  input-sm">              
                                <option value="all">全部</option>
                                <option value="1">会员</option>
                                <option value="0">非会员</option>
                            </select>
                        </div>
                        <div class="form-group" style="margin-left: 15px">
                            <label for="customer_index">指标：</label>
                            <input type="hidden" name="customer_index" id="customer_index" value="$!customer_index" /> 
                            <select multiple="multiple"  id="customer_index_mul" class="form-control  input-sm" style="width:180px;">              
                                <option value="balance_0" selected="selected">余额>0</option>
                                <option value="balance_50" selected="selected">余额>=50</option>
                                <option value="cash_balance_0" >现金余额>0</option>
                                <option value="user_num" >有账户客户</option>
                                <option value="cash_balance_50">现金余额>=50</option>
                            </select>  
                        </div>
                        <button id="refreshCustomer_btn" type="button" class="btn btn-default form-control input-sm">刷新</button>
                        <div class="btn-group btn-group-sm btn-tab" role="group" aria-label="Basic example"  style="float: right">
                            <button type="button" class="btn btn-default active btnCustomeryuePro" dateGrp='stat_date' statType='day'>日</button>
                            <button type="button" class="btn btn-default btnCustomeryuePro" dateGrp='week_num' statType='week'>周</button>
                            <button type="button" class="btn btn-default btnCustomeryuePro" dateGrp='month_num' statType='month'>月</button>
                        </div>
                    </form>
                </div>

                <div>
                    <div id="customernum" style="height:270px;"></div>
                    <div id="customeropenrate" style="height:270px;"></div>
                </div>
              </div><!-- dataShow  -->   
              <div class="panel-group accordion" id="accordion">
                    <div class="panel panel-default">
                            <div class="panel-heading">
                                <h4 class="panel-title">
                                    <a class="accordion-toggle" data-toggle="collapse" data-parent=".accordion" href="#collapseProTable">
                                    余额客户明细(点击展开) <span id="customerProTable_date"></span>
                                    </a>
                                </h4>
                            </div>
                            <div id="collapseProTable" class="panel-collapse collapse">
                                <div class="panel-body">
                                    <table class="table table-bordered" id="customerProTable">
                                        <thead>
                                          <tr>
                                            <th>用户类型</th>
                                            <th>有账户客户</th>
                                            <th>环比</th>
                                            <th>余额>0</th>
                                            <th>环比</th>
                                            <th>现金余额>0</th>
                                            <th>环比</th>
                                            <th>余额>=50</th>
                                            <th>环比</th>
                                            <th>现金余额>=50</th>
                                            <th>环比</th>
                                            <th>精准</th>
                                            <th>环比</th>
                                            <th>置顶</th>
                                            <th>环比</th>
                                            <th>智能</th>
                                            <th>环比</th>
                                          </tr>
                                        </thead>

                                    </table>
                                </div>
                            </div>
                    </div>
                   
                </div>      
                     
        </div> 

<!-- 客户余额结构部分 客户类型对比  -->

        <div class="datacontent" id="qsContent">
            <div class="dataTit">
             <a href="http://wiki.58corp.com/index.php?title=收入看板指标#.E4.BD.99.E9.A2.9D.E5.AE.A2.E6.88.B7.E7.BB.93.E6.9E.84" target="_black" 
              style="font-size: 15px;color:black">
                <i class="mark"></i><span>$!{businessName_CN} - 余额客户结构-用户类型对比</span>
            </a>
            </div>
 
            <div class="dataShow">
                <div id='customerProOption1' dateGrp='stat_date' statType='day' customerindex='balance_0'>
                    <form class="form-inline"> 
                        <div class="form-group" style="margin-left: 20%">
                            <label for="customer_type1">用户类型：</label>
                            <input type="hidden" name="customer_type1" id="customer_type1" value="$!customer_type1" /> 
                             <select multiple="multiple"  id="customer_type1_mul" class="form-control  input-sm" style="width:180px;">  
                                       
                                <option value="all">全部</option>
                                <option value="1" selected="selected">会员</option>
                                <option value="0" selected="selected">非会员</option>
                            </select>
                        </div>
                         <div class="form-group input-group-s" style="margin-left: 15px">
                            <label for="customer_index1">指标：</label>
                             <select id="customer_index1" class="form-control  input-sm">             
                                <option value="balance_0" selected="selected">余额>0</option>
                                <option value="balance_50" >余额>=50</option>
                                <option value="cash_balance_0" >现金余额>0</option>
                                <option value="user_num" >有账户客户</option>
                                <option value="cash_balance_50">现金余额>=50</option>
                            </select>  
                        </div>
                        <button id="refreshCustomer1_btn" type="button" class="btn btn-default form-control input-sm">刷新</button>
                        <div class="btn-group btn-group-sm btn-tab" role="group" aria-label="Basic example"  style="float: right">
                            <button type="button" class="btn btn-default active btnCustomertypePro" dateGrp='stat_date' statType='day'>日</button>
                            <button type="button" class="btn btn-default btnCustomertypePro" dateGrp='week_begin' statType='week'>周</button>
                            <button type="button" class="btn btn-default btnCustomertypePro" dateGrp='month_num' statType='month'>月</button>
                        </div>
                    </form>
                </div>

                <div>
                    <div id="customernum1" style="height:270px;"></div>
                    <div id="customeropenrate1" style="height:270px;"></div>
                </div>
             </div><!-- dataShow  -->    
        </div> 
<!-- 客户余额结构部分 收入漏斗图对比  -->
    <div class="dataconWrap">
        <div class="datacontent" id="qsContent">
            <div class="dataTit">
            <a href="http://wiki.58corp.com/index.php?title=收入看板指标#.E4.BD.99.E9.A2.9D.E5.AE.A2.E6.88.B7.E7.BB.93.E6.9E.84" target="_black" 
              style="font-size: 15px;color:black">
                <i class="mark"></i><span>$!{businessName_CN} - 余额客户结构-漏斗图</span>
            </a>
            </div>
 
            <div class="dataShow">
                <div id='customerFunnelOption' dateGrp='stat_date'>
                    <form class="form-inline">
                        <div  class="input-group input-group-sm" style="width: 20%;float: left">
                            <span class="input-group-addon">
                                <input id="time_checkbox_FunnelPro" type="checkbox">
                            </span>
                            <input id="time_input_FunnelPro" type="text" class="form-control time" placeholder="选择时间" disabled>
                        </div>
                        <button id="refreshFunnel_btn" type="button" class="btn btn-default form-control input-sm">刷新</button>
                        <div class="btn-group btn-group-sm btn-tab" role="group" aria-label="Basic example"  style="float: right">
                            <button type="button" class="btn btn-default active btnCustomerfunnelPro" dateGrp='stat_date' statType='day'>日</button>
                            <button type="button" class="btn btn-default btnCustomerfunnelPro" dateGrp='qtr_num' statType='week'>周</button>
                            <button type="button" class="btn btn-default btnCustomerfunnelPro" dateGrp='month_num' statType='month'>月</button>
                        </div>
                    </form>
                </div>

                <div>
                    <div class="form-group input-group-sm" style="height:10px;margin-left: 42%">
                            <label >非会员客户漏斗图</label>
                    </div>
                    <div id="customerfunnel" style="height:300px;"></div>
                    <div class="form-group input-group-sm" style="height:10px;margin-left: 42%">
                            <label >会员客户漏斗图</label>
                    </div>
                </div>
             </div><!-- dataShow  -->    
        </div> 
   </div>
<!-- 现金余额与消耗周期散点图对比  -->
<!--
    <div class="dataconWrap">
        <div class="datacontent" id="qsContent">
            <div class="dataTit">
          <a href="http://wiki.58corp.com/index.php?title=收入看板指标#.E4.BD.99.E9.A2.9D.E5.AE.A2.E6.88.B7.E7.BB.93.E6.9E.84" target="_black" 
              style="font-size: 15px;color:black">
                <i class="mark"></i><span>$!{businessName_CN} - 现金余额与消耗周期散点图</span>
            </a>
            </div>
 
            <div class="dataShow">
                <div id='customerCashcircleOption' dateGrp='week_num' statType='week'>
                    <form class="form-inline">
                        <div  class="input-group input-group-sm" style="width: 20%;float: left">
                            <span class="input-group-addon">
                                <input id="time_checkbox_CashcirclePro" type="checkbox">
                            </span>
                            <input id="time_input_CashcirclePro" type="text" class="form-control time" placeholder="选择时间" disabled>
                        </div>
                        <button id="refreshCashcircle_btn" type="button" class="btn btn-default form-control input-sm">刷新</button>
                        <div class="btn-group btn-group-sm btn-tab" role="group" aria-label="Basic example"  style="float: right">
                            <button type="button" class="btn btn-default btnCustomerCashcirclePro" dateGrp='week_num' statType='week'>周</button>
                            <button type="button" class="btn btn-default btnCustomerCashcirclePro" dateGrp='month_num' statType='month'>月</button>
                        </div>
                    </form>
                </div>

                <div>
                    <div id="customerCashcircle" style="height:400px;"></div>
                </div>
             </div>   
        </div> 
   </div>--> 
 <!-- 展现消费客户部分 -->
    <div class="dataconWrap">
        <div class="datacontent" id="qsContent">
            <div class="dataTit">
             <a href="http://wiki.58corp.com/index.php?title=收入看板指标#.E4.BD.99.E9.A2.9D.E5.AE.A2.E6.88.B7.E7.BB.93.E6.9E.84" target="_black" 
              style="font-size: 15px;color:black">
                <i class="mark"></i><span>$!{businessName_CN} - 展现消费客户</span>
            </a>
            </div> 
            <div class="dataShow">
                <div id='customerDispcostOption' dateGrp='stat_date' statType='day' dispcostproduct='jingzhun'>
                    <form class="form-inline">
                        <div  class="input-group input-group-sm" style="width: 20%;float: left">
                            <span class="input-group-addon">
                                <input id="time_checkbox_customerDispcostPro" type="checkbox">
                            </span>
                        <input id="time_input_customerDispcostPro" type="text" class="form-control time" placeholder="添加对比" disabled>
                        </div>
                         <div class="form-group input-group-s" style="margin-left:15px">
                            <label for="dispcost_product">产品线：</label>
                            <select id="dispcost_product" class="form-control  input-sm">              
                                <option value="jingzhun">精准</option>
                                <option value="zhiding">置顶</option>
                                <option value="zhineng">智能</option>
                            </select>
                        </div>
                        <button id="refreshdispcost_btn" type="button" class="btn btn-default form-control input-sm">刷新</button>
                        <div class="btn-group btn-group-sm btn-tab" role="group" aria-label="Basic example"  style="float: right">
                            <button type="button" class="btn btn-default active btndispcostPro" dateGrp='stat_date' statType='day'>日</button>
                            <button type="button" class="btn btn-default btndispcostPro" dateGrp='week_num' statType='week'>周</button>
                            <button type="button" class="btn btn-default btndispcostPro" dateGrp='month_num' statType='month'>月</button>
                        </div>
                    </form>
                </div>

                <div>
                    <div id="dispcostnum" style="height:270px;"></div>
                    <div id="dispcostopenrate" style="height:270px;"></div>
                </div>
             </div><!-- dataShow  -->    
              <div class="panel-group accordion" id="accordion">
                    <div class="panel panel-default">
                            <div class="panel-heading">
                                <h4 class="panel-title">
                                    <a class="accordion-toggle" data-toggle="collapse" data-parent=".accordion" href="#collapdispOne">
                                    展现消费客户明细(点击展开) <span id="dispcostProTable_date"></span>
                                    </a>
                                </h4>
                            </div>
                            <div id="collapdispOne" class="panel-collapse collapse">
                                <div class="panel-body">
                                    <table class="table table-bordered" id="dispcostProTable">
                                        <thead>
                                          <tr>
                                            <th>产品线类型</th>
                                            <th>展现客户数</th>
                                            <th>环比</th>
                                            <th>展现客户ARPU</th>
                                            <th>环比</th>
                                            <th>消费客户数</th>
                                            <th>环比</th>
                                            <th>消费客户数ARPU</th>
                                            <th>环比</th>
                                          </tr>
                                        </thead>
                                    </table>
                                </div>
                            </div>
                    </div>
                   
                </div>           
        </div> 
</div>
 <!-- 新增流失客户部分 -->
  <div class="datacontent" id="qsContent">
            <div class="dataTit"><!-- 整体流量   -->
            <a href="http://wiki.58corp.com/index.php?title=收入看板指标#.E4.BD.99.E9.A2.9D.E5.AE.A2.E6.88.B7.E7.BB.93.E6.9E.84" target="_black" 
              style="font-size: 15px;color:black"> 
                <i class="mark"></i><span>$!{businessName_CN} - 新增流失客户</span>
            </a>
            </div>
            <div class="dataShow">
                <div id='customerOption_product' dateGrp='week_num' AddindexType='jingzhun'>
                    <form class="form-inline">
                        <div class="form-group input-group-s" style="margin-left:50%">
                            <label for="customer_product">产品线：</label>
                            <select id="customer_product" class="form-control  input-sm">
                                <option value="jingzhun" selected>精准</option>
                                <option value="zhiding">置顶</option>
                                <option value="zhineng">智能</option>
                            </select>
                        </div>      
                        <div class="btn-group btn-group-sm btn-tab" role="group" aria-label="Basic example"  style="float: right">
                            <button type="button" class="btn btn-default customer_add" dateGrp='week_num' statType='week'>周</button>
                            <button type="button" class="btn btn-default customer_add" dateGrp='month_num' statType='month'>月</button>
                        </div> 
                    </form>              
                </div>
                
                <div id="customer_add_num" style="height:270px"></div>
                <div id="customer_add_ARPU" style="height:270px"></div>
            </div>
             <div class="panel-group accordion" id="accordion">
                    <div class="panel panel-default">
                            <div class="panel-heading">
                                <h4 class="panel-title">
                                    <a class="accordion-toggle" data-toggle="collapse" data-parent=".accordion" href="#collapseOne">
                                    新增客户明细(点击展开) <span id="customerProductTable_data"></span>
                                    </a>
                                </h4>
                            </div>
                            <div id="collapseOne" class="panel-collapse collapse">
                                <div class="panel-body">
                                    <table class="table table-bordered" id="customerProductTable">
                                        <thead>
                                          <tr>
                                            <th>产品线</th>
                                            <th>存留客户数</th>
                                            <th>环比</th>
                                            <th>新增客户数</th>
                                            <th>环比</th>
                                            <th>流失客户数</th>
                                            <th>环比</th>
                                            <th>存留客户ARPU</th>
                                            <th>环比</th>
                                            <th>新增客户ARPU</th>
                                            <th>环比</th>
                                            <th>流失客户ARPU</th>
                                            <th>环比</th>
                                          </tr>
                                        </thead>
                                    </table>
                                </div>
                            </div>
                    </div>
                   
                </div>  
        </div>
<!-- 余额消费散点图对比  
    <div class="dataconWrap">
        <div class="datacontent" id="qsContent">
            <div class="dataTit">
             <a href="http://wiki.58corp.com/index.php?title=收入看板指标#.E4.BD.99.E9.A2.9D.E5.AE.A2.E6.88.B7.E7.BB.93.E6.9E.84" target="_black" 
              style="font-size: 15px;color:black">
                <i class="mark"></i><span>$!{businessName_CN} - 新增流失客户余额消费散点图</span>
            </a>
            </div>
 
            <div class="dataShow">
                <div id='customerCostbalanceOption' dateGrp='week_num' statType='week' Costbalancetype='jingzhun'>
                    <form class="form-inline">
                        <div  class="input-group input-group-sm" style="width: 20%;float: left">
                            <span class="input-group-addon">
                                <input id="time_checkbox_CostbalancePro" type="checkbox">
                            </span>
                            <input id="time_input_CostbalancePro" type="text" class="form-control time" placeholder="选择时间" disabled>
                        </div>
                        <div class="form-group input-group-s" style="margin-left:20%">
                            <label for="Costbalance_product">产品线：</label>
                            <select id="Costbalance_product" class="form-control  input-sm">
                                <option value="jingzhun" selected>精准</option>
                                <option value="zhiding">置顶</option>
                            </select>
                        </div>      
                        <button id="refreshCostbalance_btn" type="button" class="btn btn-default form-control input-sm">刷新</button>
                        <div class="btn-group btn-group-sm btn-tab" role="group" aria-label="Basic example"  style="float: right">
                            <button type="button" class="btn btn-default btnCustomerCostbalancePro" dateGrp='week_num' statType='week'>周</button>
                            <button type="button" class="btn btn-default btnCustomerCostbalancePro" dateGrp='month_num' statType='month'>月</button>
                        </div>
                    </form>
                </div>

                <div>
                    <div id="customerCostbalance" style="height:400px;"></div>
                </div>
             </div>   
        </div> 
   </div> --> 
<!-- 客户精准置顶转换部分 -->
  <div class="datacontent" id="qsContent">
            <div class="dataTit"><!-- 整体流量   -->
            <a href="http://wiki.58corp.com/index.php?title=收入看板指标#.E4.BD.99.E9.A2.9D.E5.AE.A2.E6.88.B7.E7.BB.93.E6.9E.84" target="_black" 
              style="font-size: 15px;color:black"> 
                <i class="mark"></i><span>$!{businessName_CN} - 精准置顶转换客户</span>
            </a>
            </div>
            <div class="dataShow">
                <div id='customertransferOption' dateGrp='week_num' statType='week' TransferindexType='jingzhun' NumType='user_num'>
                    <form class="form-inline">
                        <div class="form-group input-group-s" style="margin-left:40%">
                            <label for="customertransfer_product">产品线：</label>
                            <select id="customertransfer_product" class="form-control  input-sm">
                                <option value="jingzhun" selected>精准</option>
                                <option value="zhiding">置顶</option>
                                <!-- <option value="zhineng">智能</option> -->
                            </select>
                        </div>  
                         <div class="form-group input-group-s" style="margin-left:15px">
                            <label for="customertransfer_numtype">客户数据类型：</label>
                            <select id="customertransfer_numtype" class="form-control  input-sm">
                                <option value="user_num" selected>绝对值</option>
                                <option value="user_num_per">占比</option>
                            </select>
                        </div>      
                        <div class="btn-group btn-group-sm btn-tab" role="group" aria-label="Basic example"  style="float: right">
                            <button type="button" class="btn btn-default customer_transfer" dateGrp='week_num' statType='week'>周</button>
                            <button type="button" class="btn btn-default customer_transfer" dateGrp='month_num' statType='month'>月</button>
                        </div> 
                    </form>              
                </div>
                <div id="customer_transfer_num" style="height:400px"></div>
            </div>
             <div class="panel-group accordion" id="accordion">
                    <div class="panel panel-default">
                            <div class="panel-heading">
                                <h4 class="panel-title">
                                    <a class="accordion-toggle" data-toggle="collapse" data-parent=".accordion" href="#collapseTransfer">
                                    精准置顶转换客户明细(点击展开) <span id="customerTransferTable_data"></span>
                                    </a>
                                </h4>
                            </div>
                            <div id="collapseTransfer" class="panel-collapse collapse">
                                <div class="panel-body">
                                    <table class="table table-bordered" id="customerTransferTable">
                                        <thead>
                                          <tr>
                                            <th>产品线</th>
                                            <th>TO精准</th>
                                            <th>占比</th>
                                            <th>环比</th>
                                            <th>TO置顶</th>
                                            <th>占比</th>
                                            <th>环比</th>
                                            <th>流失</th>
                                            <th>占比</th>
                                            <th>环比</th>
                                          </tr>
                                        </thead>
                                    </table>
                                </div>
                            </div>
                    </div>
                   
                </div>  
        </div>
<!-- 精准置顶转换散点图对比  -->
 <!--    <div class="dataconWrap">
        <div class="datacontent" id="qsContent">
            <div class="dataTit">
            <a href="http://wiki.58corp.com/index.php?title=收入看板指标#.E4.BD.99.E9.A2.9D.E5.AE.A2.E6.88.B7.E7.BB.93.E6.9E.84" target="_black" 
              style="font-size: 15px;color:black">
                <i class="mark"></i><span>$!{businessName_CN} - 状态转换客户余额消费散点图</span>
            </a>
            </div>
 
            <div class="dataShow">
                <div id='customerCosttransferOption' dateGrp='week_num' statType='week' Costtransfertype='jingzhun'>
                    <form class="form-inline">
                        <div  class="input-group input-group-sm" style="width: 20%;float: left">
                            <span class="input-group-addon">
                                <input id="time_checkbox_CosttransferPro" type="checkbox">
                            </span>
                            <input id="time_input_CosttransferPro" type="text" class="form-control time" placeholder="选择时间" disabled>
                        </div>
                        <div class="form-group input-group-s" style="margin-left:20%">
                            <label for="Costtransfer_product">产品线：</label>
                            <select id="Costtransfer_product" class="form-control  input-sm">
                                <option value="jingzhun" selected>精准</option>
                                <option value="zhiding">置顶</option>
                            </select>
                        </div>      
                        <button id="refreshCosttransfer_btn" type="button" class="btn btn-default form-control input-sm">刷新</button>
                        <div class="btn-group btn-group-sm btn-tab" role="group" aria-label="Basic example"  style="float: right">
                            <button type="button" class="btn btn-default btnCustomerCosttransferPro" dateGrp='week_num' statType='week'>周</button>
                            <button type="button" class="btn btn-default btnCustomerCosttransferPro" dateGrp='month_num' statType='month'>月</button>
                        </div>
                    </form>
                </div>

                <div>
                    <div id="customerCosttransfer" style="height:400px;"></div>
                </div>
             </div>   
        </div> 
   </div> -->
</div>
</body>
<script src="$!{__beat.server.contextPath}/bootstrap/jquery.js"></script>
<link rel="stylesheet" href="$!{__beat.server.contextPath}/bootstrap/libs/jquery-ui/jquery-ui-1.9.2.custom.css" type="text/css" /> 
<link type="text/css" href="$!{__beat.server.contextPath}/bootstrap/libs/jquery-ui/jquery.multiselect.css" rel="stylesheet" />
<script src="$!{__beat.server.contextPath}/bootstrap/libs/jquery-ui/jquery-ui-1.9.2.custom.min.js"></script>
<script type="text/javascript" src="$!{__beat.server.contextPath}/bootstrap/libs/jquery-ui/jquery.multiselect.js"></script>

<script src="$!{__beat.server.contextPath}/bootstrap/js/libs/bootstrap.js"></script>
<script src="$!{__beat.server.contextPath}/bootstrap/datepicker/bootstrap-datepicker.js"></script>
<script src="$!{__beat.server.contextPath}/bootstrap/datepicker/nongLiDate.js"></script>
<script src="$!{__beat.server.contextPath}/bootstrap/datepicker/locales/bootstrap-datepicker.zh-CN.js"></script>
<script src="$!{__beat.server.contextPath}/echarts2/source/echarts.js"></script>
<script src="$!{__beat.server.contextPath}/bootstrap/js/App.js"></script>
<script type="text/javascript">
    var cate = "$!{businessName}";
    var dayMap={1:"周一",2:"周二",3:"周三",4:"周四",5:"周五",6:"周六",0:"周日"};
    var datepicker_op={
        format: "yyyy-mm-dd",
        clearBtn: false,
        language: "zh-CN",
        autoclose: true,
        todayHighlight: true,
        minViewMode:0,
        orientation: "top left"
    };

    function getDate(yyyymmdd){
        if(yyyymmdd.length==10){        //yyyy-MM-dd
            return Date.parse(yyyymmdd.substr(0,4)+'/'+yyyymmdd.substr(5,2)+'/'+yyyymmdd.substr(8,2));
        }else if(yyyymmdd.length==8){   //yyyyMMdd
            return Date.parse(yyyymmdd.substr(0,4)+'/'+yyyymmdd.substr(4,2)+'/'+yyyymmdd.substr(6,2));
        }else if(yyyymmdd.length==6){    //yyyyMM
            return Date.parse(yyyymmdd.substr(0,4)+'/'+yyyymmdd.substr(4,2));
        }
    }

    //获取星期几 dayDate 的格式为 yyyy-MM-dd
    function getWeekDay(dayDate){
        var jsDate = new Date(Date.parse(dayDate.replace(/\-/g,'/')));
        var weekNumber = jsDate.getDay();
        return dayMap[weekNumber];
    }

    function setDatePicker(ec,dateGrp,input){
        if('week_begin'==dateGrp){
        }else if('month_num'==dateGrp){
            datepicker_op.minViewMode=1;
            datepicker_op.format='yyyymm';
        }else{
            datepicker_op.minViewMode=0; 
            datepicker_op.format='yyyy-mm-dd';
        }
        input.datepicker('remove');
        input.datepicker(datepicker_op);
        //获取显示的日期数组
        var days_show=ec.getShowDays();
        var days_all=ec.getAllDays();
        //设置时间可选范围
        input.datepicker('setStartDate',new Date(getDate(days_all[0])));
        input.datepicker('setEndDate',new Date(getDate(days_all[days_all.length-days_show.length])));
    }


    //格式化输出数字
    function format_number(n){
        var b=parseInt(n).toString(); 
        var len=b.length; 
        if(len<=3){return b;} 
        var r=len%3; 
        return r>0?b.slice(0,r)+","+b.slice(r,len).match(/\d{3}/g).join(","):b.slice(r,len).match(/\d{3}/g).join(","); 
    };

    //加百分号和样式
    function getRate(floatNum){
         var s=floatNum.toFixed(2)+"%";
         if(floatNum > 0){
            return '<td class="text-danger">' + s + '<span class="glyphicon glyphicon-arrow-up"></span></td>';
         }else if(floatNum < 0){
             return '<td class="text-success">' + s + '<span class="glyphicon glyphicon-arrow-down"></span></td>';
         }else{
            return '<td>' + s + '</td>';
         }
    }  

        //格式化输出数字
    function formatNum(n){
        if(n.toString().indexOf(".")>=0){
            return  n.toFixed(2);
        }else{
            return n;
        }
    };

    function changeDateGrp(item){
        var dateGrpVal = $(item).attr('dateGrp');
        var stat_type = $(item).attr('statType');
        var curDiv = $(item).closest('div[dateGrp]');
        $(curDiv).attr('dateGrp',dateGrpVal).attr('statType',stat_type);
    }

    function changeIndex(item){
        var indexVal = $(item).val();
        var curDiv = $(item).closest('div[dateGrp]');
        $(curDiv).attr('customerType',indexVal);
    }
    function changeIndex1(item){
        var indexVal = $(item).val();
        var curDiv = $(item).closest('div[dateGrp]');
        $(curDiv).attr('customerindex',indexVal);
    }
    function changeIndexForAdd(item){
        var indexVal = $(item).val();
        var curDiv = $(item).closest('div[dateGrp]');
        $(curDiv).attr('AddindexType',indexVal);
    }
    function changeIndexForCusbalance(item){
        var indexVal = $(item).val();
        var curDiv = $(item).closest('div[dateGrp]');
        $(curDiv).attr('Costbalancetype',indexVal);
    }
    function changeIndexForCustransfer(item){
        var indexVal = $(item).val();
        var curDiv = $(item).closest('div[dateGrp]');
        $(curDiv).attr('Costtransfertype',indexVal);
    }
    function changeIndexForTransfer(item){
        var indexVal = $(item).val();
        var curDiv = $(item).closest('div[dateGrp]');
        $(curDiv).attr('TransferindexType',indexVal);
    }
    function changeNumForTransfer(item){
        var indexVal = $(item).val();
        var curDiv = $(item).closest('div[dateGrp]');
        $(curDiv).attr('NumType',indexVal);
    }
    function changeIndexForProduct(item){
        var indexVal = $(item).val();
        var curDiv = $(item).closest('div[dateGrp]');
        $(curDiv).attr('dispcostproduct',indexVal);
    }
    /*function changeDispTypeIndex(item){
        var indexVal = $(item).val();
        var curDiv = $(item).closest('div[dateGrp]');
        $(curDiv).attr('indexType',indexVal);
    }*/
    $('.btn-tab button').click(function(e){
        $(this).addClass('active');
        $(this).siblings('button').each(function(){
            $(this).removeClass('active');
        });
    });
   
 
    // 路径配置
    require.config({paths: {echarts: "$!{__beat.server.contextPath}/echarts2/dist",dashboard: "$!{__beat.server.contextPath}/js/customer"}});
    
    var charts = [];

/*  余额客户模块  */
     //余额客户模块趋势图
    require(['dashboard/income_customerpro_v1'],function(customerProEC){
        charts.push(customerProEC);
        customerProEC.show(cate,2);
    });
    require(['dashboard/income_customerpro_v2'],function(customerProEC1){
        charts.push(customerProEC1);
        customerProEC1.show(cate,2);
    });
   //余额客户结构漏斗图
   require(['dashboard/income_customerfunnel_v1'],function(customerfunnel){
        charts.push(customerfunnel);
        customerfunnel.show();
    });
//  余额客户散点图 
   /* require(['dashboard/income_cashcirclescatter_v1'],function(customerProEC){
        charts.push(customerProEC);
        customerProEC.show(cate,2);
    });*/
 //展现消费客户图
    require(['dashboard/income_customerdispcost_v1'],function(sourcecustomer){
        charts.push(sourcecustomer);
        sourcecustomer.show(cate,2);
    });
     
   //新增流失客户图
    require(['dashboard/income_customeradd_v1'],function(sourcecustomer){
        charts.push(sourcecustomer);
        sourcecustomer.show(cate,2);
    });
    //新增流失消费散点图
   /* require(['dashboard/income_customerscatter_v1'],function(customerCostbalance){
        charts.push(customerCostbalance);
        customerCostbalance.show(cate,2);
    });*/
   
    //客户精准置顶转换
    require(['dashboard/income_customertransfer_v1'],function(transfercustomer){
        charts.push(transfercustomer);
        transfercustomer.show(cate,2);
    });
    //置顶转换散点图
    /*require(['dashboard/income_transferscatter_v1'],function(customerCosttransfer){
        charts.push(customerCosttransfer);
        customerCosttransfer.show(cate,2);
    });*/
    $(window).resize(function(){
        $.each(charts,function(i,n){
            n.resize();
        });
    });
</script>
</html>